#ifndef GENDERPREDICTOR_HPP
#define GENDERPREDICTOR_HPP

/*!
 *  Copyright (c) 2015 by Joshua Zhang
 * \file detector.hpp
 * \brief ssd detection module header
 */
#include "c_predict_api.h"
#include <opencv2/opencv.hpp>
#include <string>
#include <vector>

namespace FaceInfo {
class GenderAge {
 public:
	 GenderAge(const std::vector<std::string>& model_zoo, int epoch, int width, int height,
	  float mean_r, float mean_g, float mean_b,
	  int device_type = 1, int device_id = 0);
  
  int predictface(cv::Mat image, const cv::Rect& rect);

  std::pair <std::vector<float>, std::vector<float> > predict(const cv::Mat& img, int flag);
  std::pair <int, std::vector<float>> predictface_with_age(cv::Mat image, const cv::Rect& rect);

private:
	cv::Mat prepare_face(cv::Mat image, const cv::Rect& rect)const;

 private:
  bool initGender = false;
  PredictorHandle predictor_;
  PredictorHandle predictor_female;
  PredictorHandle predictor_male;

  std::vector<char> buffer_;
  unsigned int width_;
  unsigned int height_;
  float mean_r_;
  float mean_g_;
  float mean_b_;
};  // class Detector

}  //namespace det

#endif